<?php

use Carbon\Carbon;
use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
//    dump(array_diff([1,2,3], [1,2,3,4]));
//    dump(Carbon::parse('-1 week'));
    dd(ctype_space('
    '));
//    dump(array_filter([1=>'a', 2 => 'a', 3 => '  ']));
    return view('video');
});

Auth::routes();

Route::get('/questions', 'QuestionsController@index');
Route::get('/questions/{question}', 'QuestionsController@show');

//回答问题
Route::post('/questions/{question}/answers', 'AnswersController@store');

Route::get('/home', 'HomeController@index')->name('home');

Route::post('/answers/{answer}/best', 'BestAnswersController@store')->name('best-answers.store');

Route::delete('/answers/{answer}', 'AnswersController@destroy')->name('answers.destroy');
